package com.cn.hnust.controller.hcontroller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cn.hnust.pojo.Comment;
import com.cn.hnust.service.ICommentService;

@Controller
@RequestMapping(value = "/hComment")//璁剧疆璁块棶鏀规帶鍒剁被鐨�"鍒悕"
public class HCommentController {

    @Autowired
    private ICommentService commentService;

    @RequestMapping("/toComment")
    private String home(Model model, Comment comment){
        List<Comment> list=commentService.selectallComment(comment);
        model.addAttribute("commentlist", list);
        return "comment";
    }
     
    //deleteComment
    @RequestMapping("/deleteComment")
    private String deleteComment(Model model, Comment comment,Integer id){
    	commentService.deleteComment(id);
        List<Comment> list=commentService.selectallComment(comment);
        model.addAttribute("commentlist", list);
        return "comment";
    } 

}
